/*
 * Copyright 1999-2101 Alibaba Group.
 *  
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  
 *      http://www.apache.org/licenses/LICENSE-2.0
 *  
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.alibaba.dubbo.registry.common.domain;

/**
 * @author shihui
 */
public class Cache extends Entity {
    
	private static final long serialVersionUID = 182942009440121636L;
	
	private String overrideId;  /*overrideId，一个override里可能包含多个cache配置，这些cache的override相同*/

	private String service;  /*服务名*/
	
	private String application;  /*应用名*/
    
    private String address;
    
    private String method;  /*方法名*/
    
    private boolean cache = false;  /*是否启动cache*/
    
    private long expire = 300;  /*cache 过期时间，默认5分钟，单位秒*/
    
    private boolean log = true;  /*是否输出 cache hit/load 日志，默认 true*/
    
    private boolean hostNull = false;  /*是否处理 null 对象（null对象也进入缓存，避免因为null造成缓存击穿），默认 false*/
    
    private boolean reload = false;  /*是否支持 cache 预约，默认 false*/
    
    private boolean center = true;  /*是否用集中式cache，默认 true*/
    
    private boolean passby = false;  /*是否重新加载 cache（不管cache是否存在，重新从数据库加载，然后放到cache中），默认 false*/
    
    private boolean valid = false;  /*标示该cache是否可用，仅用于显示*/
    
    public Cache(){
    }

    public Cache(long id){
        super(id);
    }
    
	public String getOverrideId() {
		return overrideId;
	}

	public void setOverrideId(String overrideId) {
		this.overrideId = overrideId;
	}
    
    public String getService() {
        return service;
    }

    
    public void setService(String service) {
        this.service = service;
    }

    
    public String getAddress() {
        return address;
    }

    
    public void setAddress(String address) {
        this.address = address;
    }

	public boolean isCache() {
		return cache;
	}

	public void setCache(boolean cache) {
		this.cache = cache;
	}

	public long getExpire() {
		return expire;
	}

	public void setExpire(long expire) {
		this.expire = expire;
	}

	public boolean isLog() {
		return log;
	}

	public void setLog(boolean log) {
		this.log = log;
	}

	public boolean isHostNull() {
		return hostNull;
	}

	public void setHostNull(boolean hostNull) {
		this.hostNull = hostNull;
	}

	public boolean isReload() {
		return reload;
	}

	public void setReload(boolean reload) {
		this.reload = reload;
	}

	public boolean isCenter() {
		return center;
	}

	public void setCenter(boolean center) {
		this.center = center;
	}

	public boolean isPassby() {
		return passby;
	}

	public void setPassby(boolean passby) {
		this.passby = passby;
	}

	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		this.method = method;
	}

	public String getApplication() {
		return application;
	}

	public void setApplication(String application) {
		this.application = application;
	}

	public boolean isValid() {
		return valid;
	}

	public void setValid(boolean valid) {
		this.valid = valid;
	}

}
